<?php
require_once 'phpmoko/lib/common.php';

require_once 'phpmoko/ui/Panel.php';

class ListPanel extends Panel
{
	private $tag = 'ul';

	function __construct()
	{
		parent::__construct();
	}

	function setNumericActive($enabled)
	{
		if ($enabled)
			$this->tag = 'ol';
		else
			$this->tag = 'ul';
	}

	function getTag()
	{
		return $this->tag;
	}

	function toString()
	{
		$str = '<' . $this->tag;

		$str .= ' id="' . $this->id . '"';

		$str .= '>';

		foreach ($this as $widget) {
			$str .= '<li';

			if ($widget->style != null)
				$str .= ' class="' . $widget->style . '"';

			$str .= '>' . Widget::toStringSafe($widget) . '</li>';
		}

		$str .= '</' . $this->tag . '>';

		return $str;
	}
}
?>